<template>
  <div class="bg-color">
    <div class="order-num">
      订单号：{{code}}
    </div>

    <div class="safeguard-type">
      <div class="safeguard-item">
        <p class="afeguard-title">维权类型</p>
        <p class="afeguard-content">{{safeguardDetail.refundReason}}</p>
      </div>
      <div class="safeguard-item">
        <p class="afeguard-title">维权问题描述</p>
        <p class="afeguard-content">{{safeguardDetail.refundContent}}</p>
      </div>
    </div>

    <div class="safeguard-img">
      <div class="safeguard-item" style="padding-bottom: 0">
        <p class="afeguard-title">凭证照片</p>
        <p class="afeguard-title" style="font-size: 0.6rem">为了帮助我们更好的为你解决问题，请上传凭证照片（必填）</p>
        <ul class="afeguard-img-box">
          <!--<li></li>-->
          <!--<li></li>-->
          <!--<li></li>-->
          <!--<li></li>-->
          <li v-for="(v,k) in safeguardDetail.refundImages"  :style="'backgroundImage:url('+resUrl+v.imageUrl+')'"></li>
        </ul>
      </div>
      <div class="safeguard-item">
        <p class="afeguard-title">联系电话</p>
        <p class="afeguard-content">{{safeguardDetail.buyerMobile}}</p>
      </div>
      <p class="safeguard-warn">客服已接到你的维权请求，随后会联系你，请耐心等待</p>
    </div>

    <div class="btn-box">
      <button class="weui-btn weui-btn_warn" type="button" @click="subAfterDetail">确定</button>
    </div>


  </div>
</template>

<script>
  import {ipconfig} from '../../../../assets/js/ipconfig';
  import {getSafeguard} from '../../../../assets/js/getData';
  export default {
    name: "afterDetail",
    data(){
      return {
        resUrl:ipconfig.resUrl,//图片、视频、音频等资源访问路径
        orderId:null,//订单ID
        code:null,//订单编号
        safeguardDetail:{},//售后详情
      }
    },
    created(){
      this.orderId = this.$route.query.orderId;
      this.code = this.$route.query.code;
      getSafeguard(this.orderId).then(res => {
        if(res.data.reqResult.code > 0){
          this.safeguardDetail = res.data.data.pojo;
          console.log(this.safeguardDetail);
        }else {
          Toast(res.data.reqResult.msg);
        }
      });
    },
    methods:{
      //提交售后
      subAfterDetail(){
        this.$router.go(-1);
      },

    }
  }
</script>

<style scoped>
  .bg-color{
    min-height: 100vh;
    padding-bottom: 0.75rem;
  }
  .order-num{
    height: 2.55rem;
    line-height: 2.55rem;
    padding-left: 0.75rem;
    color: #333333;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
  }
  .safeguard-type{
    background-color: #ffffff;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    padding-bottom: 2.25rem;
  }
  .safeguard-item{
    padding: 0.75rem 0;
    border-bottom: 1px solid #E5E5E5;
  }
  .safeguard-type .safeguard-item:last-child,.safeguard-img .safeguard-item:last-child{
    border-bottom: none;
  }
  .afeguard-title{
    color: #999999;
    font-size: 0.65rem;
    padding-bottom: 0.6rem;
  }
  .afeguard-content{
    color: #333333;
    font-size: 0.75rem;
    line-height: 0.9rem;
  }
  .safeguard-img{
    background-color: #ffffff;
    padding: 0 0.75rem;
  }
  .safeguard-warn{
    height: 2.1rem;
    line-height: 2.1rem;
    color: #C50000;
    font-size: 0.65rem;
    padding-left: 1rem;
    background-image: url("../../../../../static/images/order/wran.png");
    background-repeat: no-repeat;
    background-size: 0.65rem 0.65rem;
    background-position: left center;
  }
  .afeguard-img-box{
    display: flex;
    flex-wrap: wrap;
  }
  .afeguard-img-box li{
    width: 3.9rem;
    height: 3.9rem;
    margin-right: 0.45rem;
    margin-bottom: 1.1rem;
    background-origin: content-box;
    background-position:50% 50%;
    background-size:contain;
    background-repeat:no-repeat;
    background-color: rgba(0,0,0,0.2);
  }
  .afeguard-img-box li:nth-child(4){
    margin-right: 0;
  }
  .afeguard-img-box li:nth-child(n+4){
    margin-bottom: 0.85rem;
  }
  .btn-box{
    margin-top: 1rem;
    padding: 0 0.75rem;
  }
</style>
